package org.api.free.controller;

import lombok.extern.slf4j.Slf4j;
import org.api.free.service.ocr.WxSignatureCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1")
@Slf4j
public class WxSignatureCheckController {

    @Autowired
    private WxSignatureCheckService wxSignatureCheckService;

    @RequestMapping("/wxCheck")
    public String wxSignatureCheck(@RequestParam(value = "signature") String signature,//
                                   @RequestParam(value = "timestamp") String timestamp,  //
                                   @RequestParam(value = "nonce") String nonce, //
                                   @RequestParam(value = "echostr") String echostr) {
        return wxSignatureCheckService.wxSignatureCheck(signature, timestamp, nonce, echostr);
    }

}

